##    This library is free software; you can redistribute it and/or
##    modify it under the terms of the GNU Lesser General Public
##    License as published by the Free Software Foundation; either
##    version 2.1 of the License, or (at your option) any later version.
##
##    This library is distributed in the hope that it will be useful,
##    but WITHOUT ANY WARRANTY; without even the implied warranty of
##    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
##    Lesser General Public License for more details.
##
##    You should have received a copy of the GNU Lesser General Public
##    License along with this library; if not, write to the Free Software
##    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from google.appengine.ext import db

class Gift(db.Model):
  name = db.StringProperty()

class GiftTransaction(db.Model):
  sender_id = db.StringProperty()
  receiver_id = db.StringProperty()
  gift = db.ReferenceProperty(Gift)

class User(db.Model):
  name = db.StringProperty()
  id = db.StringProperty()
  orkutId = db.StringProperty()
           
class Product(db.Model):
  name = db.StringProperty() #product title
  siteName = db.StringProperty() #e.g, BestBuy
  siteSku = db.StringProperty()
  type = db.StringProperty()  #notebook
  brand = db.StringProperty() #Apple
  model = db.StringProperty() #e.g, 
  url = db.StringProperty()
  imageurl = db.StringProperty()
  latestPrice = db.StringProperty()
  latestPriceDate = db.DateTimeProperty()
  
class Envy(db.Model):
  user = db.ReferenceProperty(User, collection_name='envies')
  product = db.ReferenceProperty(Product)
  envy = db.StringProperty(choices=set(["Hate it", "Lukewarm", "Love it"]))
  priceEnvy = db.StringProperty()
  owningStatus = db.StringProperty(choices=set(["wish", "envy"]))
  createdDate = db.DateTimeProperty(auto_now_add=True)
  updatedDate = db.DateTimeProperty(auto_now=True)
  posted = db.BooleanProperty(default=False)
  lastAction = db.StringProperty()

class Review(db.Model):
  user = db.ReferenceProperty(User)
  product = db.ReferenceProperty(Product)
  review = db.StringListProperty()
  createdDate = db.DateTimeProperty(auto_now_add=True)
  